package com.example.application.bean;

import java.io.Serializable;

/**
 * 返回到前端的包装对象
 * @param <T> 将指定对象包装后返回到前端
 */
public class ResultBean<T> implements Serializable {
    /**
     * 返回状态码
     */
    private int code;

    /**
     * 需要返回的对象
     */
    private T t;

    /**
     * 附加信息
     */
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ResultBean{" +
                "code=" + code +
                ", t=" + t +
                ", msg='" + msg + '\'' +
                '}';
    }
}
